package com.edison.demo.until;

import java.util.Random;

/**
 * @author edison
 */
public class OpenAcctTelrNoGenerator {

    private OpenAcctTelrNoGenerator(){
        throw new IllegalStateException("Utility class");
    }

    private static final Random RANDOM = new Random();

    public static String generateOpenAcctTelrNo() {
        int patternType = RANDOM.nextInt(3);

        switch (patternType) {
            case 0:
                // Generate a 5-digit number
                return String.format("%05d", RANDOM.nextInt(100000));
            case 1:
                // Generate a 6-digit number
                return String.format("%06d", RANDOM.nextInt(1000000));
            case 2:
                // Generate an alphanumeric "N" pattern
                return "N" + String.format("%05d", RANDOM.nextInt(100000));
            default:
                throw new IllegalStateException("Unexpected value: " + patternType);
        }
    }


}
